// 入口文件

import Vue from 'vue'

import Vuex from 'vuex'

Vue.use(Vuex)
 
//1.1导入路由的包
import VueRouter from 'vue-router'
//1.2安装包
Vue.use(VueRouter)

import moment from 'moment'
//定义全局的过滤器
Vue.filter('dateFormat',function(dataStr,pattern = 'YYYY-MM-DD HH:mm:ss'){
    return moment(dataStr).format(pattern);
})

//2.1导入vue-resource
import VueResource from 'vue-resource'
//2.2安装包
Vue.use(VueResource)
Vue.http.options.emulateJSON = true;
Vue.http.options.root = 'http://vue.studyit.io/';

//导入 mui 的样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

//按需导入 mint-UI 中的组件
// import { Header, Swipe, SwipeItem, Button, Lazyload } from 'mint-ui'
// Vue.component(Header.name, Header)  
// Vue.component(Swipe.name, Swipe);
// Vue.component(SwipeItem.name, SwipeItem);
// Vue.component(Button.name, Button);
// Vue.use(Lazyload);

import MintUI from 'mint-ui'
Vue.use(MintUI)
import 'mint-ui/lib/style.css'

//图片预览插件
import VuePreview from 'vue-preview'
// defalut install
Vue.use(VuePreview)

//1.3 导入自己的router.js 路由模块
import router from './router.js'
import store from './store.js'

//导入app根组件
import app from './app.vue' 

 
var vm = new Vue({
    el:'#app',
    render: c => c(app),
    router:router,
    store
})